package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2021-03-03
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_wx_user_info")
@ApiModel(value = "WxUserInfo", description = "")
@AllArgsConstructor
public class WxUserInfo extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * openid
     */
    @ApiModelProperty(value = "openid")
    @Length(max = 255, message = "openid长度不能超过255")
    @TableField(value = "open_id", condition = LIKE)
    @Excel(name = "openid")
    private String openId;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "session_key", condition = LIKE)
    @Excel(name = "")
    private String sessionKey;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "union_id", condition = LIKE)
    @Excel(name = "")
    private String unionId;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "phone_number", condition = LIKE)
    @Excel(name = "")
    private String phoneNumber;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "pure_phone_number", condition = LIKE)
    @Excel(name = "")
    private String purePhoneNumber;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "country_code", condition = LIKE)
    @Excel(name = "")
    private String countryCode;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "watermark", condition = LIKE)
    @Excel(name = "")
    private String watermark;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "nick_name", condition = LIKE)
    @Excel(name = "")
    private String nickName;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "gender", condition = LIKE)
    @Excel(name = "")
    private String gender;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "city", condition = LIKE)
    @Excel(name = "")
    private String city;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "province", condition = LIKE)
    @Excel(name = "")
    private String province;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "contry", condition = LIKE)
    @Excel(name = "")
    private String contry;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "avatar_url", condition = LIKE)
    @Excel(name = "")
    private String avatarUrl;


    @Builder
    public WxUserInfo(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long updateUser, Long createUser, 
                    String openId, String sessionKey, String unionId, String phoneNumber, String purePhoneNumber, 
                    String countryCode, String watermark, String nickName, String gender, String city, String province, 
                    String contry, String avatarUrl) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.createUser = createUser;
        this.openId = openId;
        this.sessionKey = sessionKey;
        this.unionId = unionId;
        this.phoneNumber = phoneNumber;
        this.purePhoneNumber = purePhoneNumber;
        this.countryCode = countryCode;
        this.watermark = watermark;
        this.nickName = nickName;
        this.gender = gender;
        this.city = city;
        this.province = province;
        this.contry = contry;
        this.avatarUrl = avatarUrl;
    }

}
